﻿<%@ Page Title="Kids" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="KidsList.aspx.cs" Inherits="MyLocalChurch.KidsChurch.KidsList" %>
<%@ Import Namespace="MyLocalChurch.Business" %>
<%@ Import Namespace="MyLocalChurch.Models.Enumerations" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2><asp:Label ID="lblHeader" runat="server"></asp:Label></h2>
    <asp:Panel runat="server" ID="panelRegisterKid">
        <a href="CreateKid.aspx?GuardianId=<%: Request.QueryString[MyLocalChurch.Constants.QueryParameters.GuardianId] %>">Register New Kid</a>
    </asp:Panel>
    <table>
        <thead>
            <tr>
                <th>First Name</th>
                <th>Middle Name</th>
                <th>Last Name</th>
                <th>Nick Name</th>
                <th>Gender</th>
                <th>Birthdate</th>
                <th>Category</th>
                <th>Relationship</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <asp:Repeater ID="rptKids" runat="server" OnItemDataBound="rptKids_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td><%# DataBinder.Eval(Container.DataItem, "FirstName") %></td>
                        <td><%# DataBinder.Eval(Container.DataItem, "MiddleName") %></td>
                        <td><%# DataBinder.Eval(Container.DataItem, "LastName") %></td>
                        <td><%# DataBinder.Eval(Container.DataItem, "NickName") %></td>
                        <td><%# (Gender)DataBinder.Eval(Container.DataItem, "Gender") %></td>
                        <td><%# DataBinder.Eval(Container.DataItem, "Birthdate", "{0:M/d/yyyy}")%></td>
                        <td><asp:Label ID="lblKidCategory" runat="server"></asp:Label></td>
                        <td><%# DataBinder.Eval(Container.DataItem, "RelationshipWithGuardian") %></td>
                        <td>
                            <a id="linkBarcode" runat="server" target="_blank">Barcode</a>
                            <asp:Label ID="lblBarcode" runat="server" Text="Barcode" Visible="false"></asp:Label>
                            | <a href="EditKid.aspx?GuardianId=<%: Request.QueryString[MyLocalChurch.Constants.QueryParameters.GuardianId] %>&KidId=<%# DataBinder.Eval(Container.DataItem, "Id") %>">Edit</a>
                            | <a id="linkCheckInOrOut" runat="server">Check In</a>
                            <asp:Label ID="lblCheckIn" runat="server" Text="Check In" Visible="false"></asp:Label>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </tbody>
    </table>
</asp:Content>
